Statistical Examination of Challenge Test Data and Modelling
2024-04-30
Import a .csv file to R softwareCheck a challenge test data setSelect an adequate primary growth modelFit a primary growth model toExamine the fitting resultsObtain the confidence and prediction intervalsR script: Unit1-ChallengeTestsDataAnalysisPGM.Rchallenge test
ecoli.csvExperiments were carried out at 30 and 35 \(^o\)Cconditionread.csv() functionhead() functionstr() functionobservations (lines) and 5 variables(columns)'data.frame': 42 obs. of 5 variables:
$ Condition : int 1 1 1 1 1 1 1 1 1 1 ...
$ Repetition: int 1 1 1 1 1 1 1 1 1 1 ...
$ Time : num 0 3 5 7 9 11 13 15 16 20 ...
$ Temp : int 30 30 30 30 30 30 30 30 30 30 ...
$ lnN : num 5.93 5.82 6.04 7.45 10.38 ...
Condition and Temptable() function
1 2
22 20
30 35
22 20
Condition/Temp
30 35
1 22 0
2 0 20
lnN against TimelnN) increases along TimelnN shows a non-linear (sigmoidal) relationship with TimeDescribe the microorganisms responses to the food environments
We can predict the growth behaviour of the microorganisms for specific environmental conditions, such as: pH, salt content, temperature, etc.
Primary growth models are characterised by the kinetic growth parameters
primary growth models have been developed and tested for predictive microbiology applications
R software
freestatistical analysis and plotsfit non-linear models to experimental data
nls() function from the```stats packagegsl_nls() from gslnls package (GNU Scientific Library)R software: https://cran.r-project.org/predmicror package: https://fsqanalytics.github.io/predmicror/Huang full growth model might be a good option to describe the sigmoidal shape of the data
\[Y = Y_0 +Y_{max} -log \left( e^{Y_0}+(e^{Y_{max}}-e^{Y_0}) \times e^{-mu \times B} \right)\]
non-linear models we need to we need to supply starting values for the model parametersHuang model to the experimental dataCondition 1 & Repetition 1library(predmicror)
library(gslnls)
fit <- gsl_nls(lnN ~ HuangFM(Time, Y0, Ymax, MUmax, lag),
data=df[df$Condition==1 & df$Repetition==1, ],
start = start.values
)
fitNonlinear regression model
model: lnN ~ HuangFM(Time, Y0, Ymax, MUmax, lag)
data: df[df$Condition == 1 & df$Repetition == 1, ]
Y0 Ymax MUmax lag
5.918 18.840 1.182 5.584
residual sum-of-squares: 0.4724
Algorithm: multifit/levenberg-marquardt, (scaling: more, solver: qr)
Number of iterations to convergence: 5
Achieved convergence tolerance: 8.214e-11
successful!summary() function
Formula: lnN ~ HuangFM(Time, Y0, Ymax, MUmax, lag)
Parameters:
Estimate Std. Error t value Pr(>|t|)
Y0 5.91795 0.15454 38.29 2.15e-09 ***
Ymax 18.83981 0.18286 103.03 2.14e-12 ***
MUmax 1.18173 0.03892 30.36 1.09e-08 ***
lag 5.58393 0.25000 22.34 9.12e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2598 on 7 degrees of freedom
Number of iterations to convergence: 5
Achieved convergence tolerance: 8.214e-11
confint() functionpredict() function to compute the prediction intervalfits <- predict(fit,
newdata = data.frame(Time=new.times),
interval = "prediction", level = 0.95)
str(fits) num [1:241, 1:3] 5.92 5.92 5.92 5.92 5.92 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:3] "fit" "lwr" "upr"
fits objectplot() functionlines() function to add the confidence intervalShiny app PredMicro: https://vcadavez.shinyapps.io/PredMicro/